package Day06;

import java.util.Random;

public class MethodDemo {
    public static void main(String[] args) {
        /*
        say();
        say();
        System.out.println("JAVA是世界最好的语言.py");
        System.out.println("---------------------------------");
        sayhello("LJ",21,"China ChenDu");
        int a=sum(4,6);//sum(4,6)的值就是return后的那个数
        System.out.println(a);//模拟对返回值的后续操作
        int m=10,n=20;
        int mn=sum(m,n);
        System.out.println(mn);
        int[] a1=grnerateArray(10,100);
        System.out.println("长度="+a1.length);
        for (int i=0;i< a1.length;i++){
            System.out.println(a1[i]);
        }
        System.out.println();
        Arrays.sort(a1);
        for (int i= a1.length-1;i>=0;i--){
            System.out.println(a1[i]);
        }
         */

        say();
        say("LJ",21,"ChengDu");

    }
    public static void say(){
        System.out.println("零基础 学IT 月薪过万 就来xxx");
    }
    public static void say(String name,int age,String from){
        if (age>60){
            return;
        }
        System.out.println("大家好我叫"+name+"，今年"+age+"岁了。"+"来自"+from);
    }
    public static int sum(int num1,int num2){
        int num=num1+num2;
        return num;//返回的是num里面的数
        //return num1+num2;//返回的是num1与num2的和
    }
    public static int[] grnerateArray(int len,int max){
        Random rand=new Random();
        int[] arr=new int[len];
        for (int i=0;i< arr.length;i++){
            arr[i]= rand.nextInt(max+1);
        }
        return arr;
    }
    //public static void say(){return ;}//重载与返回值类型无关
    //public static void sum(int axm,int max){}//重载于参数名称无关
}